// pages/giftShop/afterSale/afterType/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    detail:null,//页面信息
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      detail: JSON.parse(decodeURIComponent(options.currency)) || null,
    })
    console.log(this.data.detail)
  },

  /**
   * 跳转到换货页面
   */
  goExchangeGoods:function(e){
    wx.reportAnalytics('gift_after_type');
    let type = e.currentTarget.dataset.type
    wx.navigateTo({
      url: `/pages/giftShop/serviceOrder/exchangeGoods/index?currency=${encodeURIComponent(JSON.stringify(this.data.detail))}&serviceType=${type}`
    })
  }
})